package com.macoli.android_test;

import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;



import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    List<Bitmap> bitmapList = new ArrayList<>() ;
    List<byte[]> bufferList = new ArrayList<>() ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState) ;
        setContentView(R.layout.activity_main) ;

        "com.macoli.android_test.MainActivity.lambda$onCreate$0".contains("$") ;

        findViewById(R.id.anr_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.i("gggl1", "enter: com.macoli.android_test.MainActivity.lambda$onCreate$0");
                try {
                    SystemClock.sleep(100000);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });



    }

    private Bitmap loadImg() throws IOException {
        AssetManager assetManager = getAssets();
        InputStream is = assetManager.open("1.png");
        //以下注释掉的代码不靠谱.若采用,会有异常
        //InputStream is = assetManager.open("file:///android_asset/Fresh_01.jpg");
        return BitmapFactory.decodeStream(is);
    }
}